<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GSocketListener</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GIO 参考手册">
<link rel="up" href="highlevel-socket.html" title="Highlevel network functionallity">
<link rel="prev" href="gio-GTcpWrapperConnection.html" title="GTcpWrapperConnection">
<link rel="next" href="gio-GSocketService.html" title="GSocketService">
<meta name="generator" content="GTK-Doc V1.17 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gio-GTcpWrapperConnection.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="highlevel-socket.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GIO 参考手册</th>
<td><a accesskey="n" href="gio-GSocketService.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gio-GSocketListener.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gio-GSocketListener.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="gio-GSocketListener"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gio-GSocketListener.top_of_page"></a>GSocketListener</span></h2>
<p>GSocketListener — Helper for accepting network client connections</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gio-GSocketListener.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">                    <a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener">GSocketListener</a>;
<a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="returnvalue">GSocketListener</span></a> *        <a class="link" href="gio-GSocketListener.html#g-socket-listener-new" title="g_socket_listener_new ()">g_socket_listener_new</a>          (<em class="parameter"><code><span class="type">void</span></code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gio-GSocketListener.html#g-socket-listener-add-socket" title="g_socket_listener_add_socket ()">g_socket_listener_add_socket</a>        (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GSocket.html#GSocket" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *source_object</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gio-GSocketListener.html#g-socket-listener-add-address" title="g_socket_listener_add_address ()">g_socket_listener_add_address</a>       (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GSocketAddress.html#GSocketAddress" title="GSocketAddress"><span class="type">GSocketAddress</span></a> *address</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GSocket.html#GSocketType" title="enum GSocketType"><span class="type">GSocketType</span></a> type</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GSocket.html#GSocketProtocol" title="enum GSocketProtocol"><span class="type">GSocketProtocol</span></a> protocol</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *source_object</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GSocketAddress.html#GSocketAddress" title="GSocketAddress"><span class="type">GSocketAddress</span></a> **effective_address</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gio-GSocketListener.html#g-socket-listener-add-inet-port" title="g_socket_listener_add_inet_port ()">g_socket_listener_add_inet_port</a>     (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint16"><span class="type">guint16</span></a> port</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *source_object</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="../glib/glib-Basic-Types.html#guint16"><span class="returnvalue">guint16</span></a>             <a class="link" href="gio-GSocketListener.html#g-socket-listener-add-any-inet-port" title="g_socket_listener_add_any_inet_port ()">g_socket_listener_add_any_inet_port</a> (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *source_object</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a class="link" href="gio-GSocketConnection.html#GSocketConnection" title="GSocketConnection"><span class="returnvalue">GSocketConnection</span></a> *      <a class="link" href="gio-GSocketListener.html#g-socket-listener-accept" title="g_socket_listener_accept ()">g_socket_listener_accept</a>       (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> **source_object</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GCancellable.html#GCancellable" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gio-GSocketListener.html#g-socket-listener-accept-async" title="g_socket_listener_accept_async ()">g_socket_listener_accept_async</a>      (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GCancellable.html#GCancellable" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
<a class="link" href="gio-GSocketConnection.html#GSocketConnection" title="GSocketConnection"><span class="returnvalue">GSocketConnection</span></a> *      <a class="link" href="gio-GSocketListener.html#g-socket-listener-accept-finish" title="g_socket_listener_accept_finish ()">g_socket_listener_accept_finish</a>
                                                        (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncResult" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> **source_object</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a class="link" href="gio-GSocket.html#GSocket" title="GSocket"><span class="returnvalue">GSocket</span></a> *                <a class="link" href="gio-GSocketListener.html#g-socket-listener-accept-socket" title="g_socket_listener_accept_socket ()">g_socket_listener_accept_socket</a>
                                                        (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> **source_object</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GCancellable.html#GCancellable" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gio-GSocketListener.html#g-socket-listener-accept-socket-async" title="g_socket_listener_accept_socket_async ()">g_socket_listener_accept_socket_async</a>
                                                        (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GCancellable.html#GCancellable" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
<a class="link" href="gio-GSocket.html#GSocket" title="GSocket"><span class="returnvalue">GSocket</span></a> *                <a class="link" href="gio-GSocketListener.html#g-socket-listener-accept-socket-finish" title="g_socket_listener_accept_socket_finish ()">g_socket_listener_accept_socket_finish</a>
                                                        (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncResult" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> **source_object</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gio-GSocketListener.html#g-socket-listener-close" title="g_socket_listener_close ()">g_socket_listener_close</a>             (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gio-GSocketListener.html#g-socket-listener-set-backlog" title="g_socket_listener_set_backlog ()">g_socket_listener_set_backlog</a>       (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> listen_backlog</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="gio-GSocketListener.description"></a><h2>Description</h2>
<p>
A <a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> is an object that keeps track of a set
of server sockets and helps you accept sockets from any of the
socket, either sync or async.
</p>
<p>
If you want to implement a network server, also look at <a class="link" href="gio-GSocketService.html#GSocketService" title="GSocketService"><span class="type">GSocketService</span></a>
and <a class="link" href="gio-GThreadedSocketService.html#GThreadedSocketService" title="GThreadedSocketService"><span class="type">GThreadedSocketService</span></a> which are subclass of <a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a>
that makes this even easier.
</p>
</div>
<div class="refsect1">
<a name="gio-GSocketListener.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GSocketListener"></a><h3>GSocketListener</h3>
<pre class="programlisting">typedef struct _GSocketListener GSocketListener;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="g-socket-listener-new"></a><h3>g_socket_listener_new ()</h3>
<pre class="programlisting"><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="returnvalue">GSocketListener</span></a> *        g_socket_listener_new          (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Creates a new <a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> with no sockets to listen for.
New listeners can be added with e.g. <a class="link" href="gio-GSocketListener.html#g-socket-listener-add-address" title="g_socket_listener_add_address ()"><code class="function">g_socket_listener_add_address()</code></a>
or <a class="link" href="gio-GSocketListener.html#g-socket-listener-add-inet-port" title="g_socket_listener_add_inet_port ()"><code class="function">g_socket_listener_add_inet_port()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a>.</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2">
<a name="g-socket-listener-add-socket"></a><h3>g_socket_listener_add_socket ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_socket_listener_add_socket        (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GSocket.html#GSocket" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *source_object</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Adds <em class="parameter"><code>socket</code></em> to the set of sockets that we try to accept
new clients from. The socket must be bound to a local
address and listened to.
</p>
<p>
<em class="parameter"><code>source_object</code></em> will be passed out in the various calls
to accept to identify this particular source, which is
useful if you're listening on multiple addresses and do
different things depending on what address is connected to.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>listener</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>socket</code></em> :</span></p></td>
<td>a listening <a class="link" href="gio-GSocket.html#GSocket" title="GSocket"><span class="type">GSocket</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>source_object</code></em> :</span></p></td>
<td>Optional <a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> identifying this source. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>
<a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> on error.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2">
<a name="g-socket-listener-add-address"></a><h3>g_socket_listener_add_address ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_socket_listener_add_address       (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GSocketAddress.html#GSocketAddress" title="GSocketAddress"><span class="type">GSocketAddress</span></a> *address</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GSocket.html#GSocketType" title="enum GSocketType"><span class="type">GSocketType</span></a> type</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GSocket.html#GSocketProtocol" title="enum GSocketProtocol"><span class="type">GSocketProtocol</span></a> protocol</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *source_object</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GSocketAddress.html#GSocketAddress" title="GSocketAddress"><span class="type">GSocketAddress</span></a> **effective_address</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Creates a socket of type <em class="parameter"><code>type</code></em> and protocol <em class="parameter"><code>protocol</code></em>, binds
it to <em class="parameter"><code>address</code></em> and adds it to the set of sockets we're accepting
sockets from.
</p>
<p>
Note that adding an IPv6 address, depending on the platform,
may or may not result in a listener that also accepts IPv4
connections.  For more determinstic behaviour, see
<a class="link" href="gio-GSocketListener.html#g-socket-listener-add-inet-port" title="g_socket_listener_add_inet_port ()"><code class="function">g_socket_listener_add_inet_port()</code></a>.
</p>
<p>
<em class="parameter"><code>source_object</code></em> will be passed out in the various calls
to accept to identify this particular source, which is
useful if you're listening on multiple addresses and do
different things depending on what address is connected to.
</p>
<p>
If successful and <em class="parameter"><code>effective_address</code></em> is non-<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> then it will
be set to the address that the binding actually occured at.  This
is helpful for determining the port number that was used for when
requesting a binding to port 0 (ie: "any port").  This address, if
requested, belongs to the caller and must be freed.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>listener</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>address</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSocketAddress.html#GSocketAddress" title="GSocketAddress"><span class="type">GSocketAddress</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSocket.html#GSocketType" title="enum GSocketType"><span class="type">GSocketType</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>protocol</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSocket.html#GSocketProtocol" title="enum GSocketProtocol"><span class="type">GSocketProtocol</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>source_object</code></em> :</span></p></td>
<td>Optional <a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> identifying this source. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>effective_address</code></em> :</span></p></td>
<td>location to store the address that was bound to, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>
<a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> on error.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2">
<a name="g-socket-listener-add-inet-port"></a><h3>g_socket_listener_add_inet_port ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_socket_listener_add_inet_port     (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint16"><span class="type">guint16</span></a> port</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *source_object</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Helper function for <a class="link" href="gio-GSocketListener.html#g-socket-listener-add-address" title="g_socket_listener_add_address ()"><code class="function">g_socket_listener_add_address()</code></a> that
creates a TCP/IP socket listening on IPv4 and IPv6 (if
supported) on the specified port on all interfaces.
</p>
<p>
<em class="parameter"><code>source_object</code></em> will be passed out in the various calls
to accept to identify this particular source, which is
useful if you're listening on multiple addresses and do
different things depending on what address is connected to.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>listener</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>port</code></em> :</span></p></td>
<td>an IP port number (non-zero)</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>source_object</code></em> :</span></p></td>
<td>Optional <a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> identifying this source. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>
<a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> on error.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2">
<a name="g-socket-listener-add-any-inet-port"></a><h3>g_socket_listener_add_any_inet_port ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#guint16"><span class="returnvalue">guint16</span></a>             g_socket_listener_add_any_inet_port (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *source_object</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Listens for TCP connections on any available port number for both
IPv6 and IPv4 (if each are available).
</p>
<p>
This is useful if you need to have a socket for incoming connections
but don't care about the specific port number.
</p>
<p>
<em class="parameter"><code>source_object</code></em> will be passed out in the various calls
to accept to identify this particular source, which is
useful if you're listening on multiple addresses and do
different things depending on what address is connected to.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>listener</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>source_object</code></em> :</span></p></td>
<td>Optional <a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> identifying this source. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> location to store the error occuring, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to
ignore.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the port number, or 0 in case of failure.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="g-socket-listener-accept"></a><h3>g_socket_listener_accept ()</h3>
<pre class="programlisting"><a class="link" href="gio-GSocketConnection.html#GSocketConnection" title="GSocketConnection"><span class="returnvalue">GSocketConnection</span></a> *      g_socket_listener_accept       (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> **source_object</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GCancellable.html#GCancellable" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Blocks waiting for a client to connect to any of the sockets added
to the listener. Returns a <a class="link" href="gio-GSocketConnection.html#GSocketConnection" title="GSocketConnection"><span class="type">GSocketConnection</span></a> for the socket that was
accepted.
</p>
<p>
If <em class="parameter"><code>source_object</code></em> is not <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> it will be filled out with the source
object specified when the corresponding socket or address was added
to the listener.
</p>
<p>
If <em class="parameter"><code>cancellable</code></em> is not <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then the operation can be cancelled by
triggering the cancellable object from another thread. If the operation
was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>listener</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>source_object</code></em> :</span></p></td>
<td>location where <a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> pointer will be stored, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td>optional <a class="link" href="gio-GCancellable.html#GCancellable" title="GCancellable"><span class="type">GCancellable</span></a> object, <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>
<a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a class="link" href="gio-GSocketConnection.html#GSocketConnection" title="GSocketConnection"><span class="type">GSocketConnection</span></a> on success, <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2">
<a name="g-socket-listener-accept-async"></a><h3>g_socket_listener_accept_async ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_socket_listener_accept_async      (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GCancellable.html#GCancellable" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
This is the asynchronous version of <a class="link" href="gio-GSocketListener.html#g-socket-listener-accept" title="g_socket_listener_accept ()"><code class="function">g_socket_listener_accept()</code></a>.
</p>
<p>
When the operation is finished <em class="parameter"><code>callback</code></em> will be
called. You can then call <a class="link" href="gio-GSocketListener.html#g-socket-listener-accept-socket" title="g_socket_listener_accept_socket ()"><code class="function">g_socket_listener_accept_socket()</code></a>
to get the result of the operation.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>listener</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GCancellable.html#GCancellable" title="GCancellable"><span class="type">GCancellable</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>. <span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data for the callback. <span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2">
<a name="g-socket-listener-accept-finish"></a><h3>g_socket_listener_accept_finish ()</h3>
<pre class="programlisting"><a class="link" href="gio-GSocketConnection.html#GSocketConnection" title="GSocketConnection"><span class="returnvalue">GSocketConnection</span></a> *      g_socket_listener_accept_finish
                                                        (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncResult" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> **source_object</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Finishes an async accept operation. See <a class="link" href="gio-GSocketListener.html#g-socket-listener-accept-async" title="g_socket_listener_accept_async ()"><code class="function">g_socket_listener_accept_async()</code></a>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>listener</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GAsyncResult.html#GAsyncResult" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>source_object</code></em> :</span></p></td>
<td>Optional <a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> identifying this source. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> location to store the error occuring, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to
ignore.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a class="link" href="gio-GSocketConnection.html#GSocketConnection" title="GSocketConnection"><span class="type">GSocketConnection</span></a> on success, <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2">
<a name="g-socket-listener-accept-socket"></a><h3>g_socket_listener_accept_socket ()</h3>
<pre class="programlisting"><a class="link" href="gio-GSocket.html#GSocket" title="GSocket"><span class="returnvalue">GSocket</span></a> *                g_socket_listener_accept_socket
                                                        (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> **source_object</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GCancellable.html#GCancellable" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Blocks waiting for a client to connect to any of the sockets added
to the listener. Returns the <a class="link" href="gio-GSocket.html#GSocket" title="GSocket"><span class="type">GSocket</span></a> that was accepted.
</p>
<p>
If you want to accept the high-level <a class="link" href="gio-GSocketConnection.html#GSocketConnection" title="GSocketConnection"><span class="type">GSocketConnection</span></a>, not a <a class="link" href="gio-GSocket.html#GSocket" title="GSocket"><span class="type">GSocket</span></a>,
which is often the case, then you should use <a class="link" href="gio-GSocketListener.html#g-socket-listener-accept" title="g_socket_listener_accept ()"><code class="function">g_socket_listener_accept()</code></a>
instead.
</p>
<p>
If <em class="parameter"><code>source_object</code></em> is not <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> it will be filled out with the source
object specified when the corresponding socket or address was added
to the listener.
</p>
<p>
If <em class="parameter"><code>cancellable</code></em> is not <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then the operation can be cancelled by
triggering the cancellable object from another thread. If the operation
was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>listener</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>source_object</code></em> :</span></p></td>
<td>location where <a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> pointer will be stored, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td>optional <a class="link" href="gio-GCancellable.html#GCancellable" title="GCancellable"><span class="type">GCancellable</span></a> object, <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>
<a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a class="link" href="gio-GSocket.html#GSocket" title="GSocket"><span class="type">GSocket</span></a> on success, <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2">
<a name="g-socket-listener-accept-socket-async"></a><h3>g_socket_listener_accept_socket_async ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_socket_listener_accept_socket_async
                                                        (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GCancellable.html#GCancellable" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
This is the asynchronous version of <a class="link" href="gio-GSocketListener.html#g-socket-listener-accept-socket" title="g_socket_listener_accept_socket ()"><code class="function">g_socket_listener_accept_socket()</code></a>.
</p>
<p>
When the operation is finished <em class="parameter"><code>callback</code></em> will be
called. You can then call <a class="link" href="gio-GSocketListener.html#g-socket-listener-accept-socket-finish" title="g_socket_listener_accept_socket_finish ()"><code class="function">g_socket_listener_accept_socket_finish()</code></a>
to get the result of the operation.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>listener</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GCancellable.html#GCancellable" title="GCancellable"><span class="type">GCancellable</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>. <span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data for the callback. <span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2">
<a name="g-socket-listener-accept-socket-finish"></a><h3>g_socket_listener_accept_socket_finish ()</h3>
<pre class="programlisting"><a class="link" href="gio-GSocket.html#GSocket" title="GSocket"><span class="returnvalue">GSocket</span></a> *                g_socket_listener_accept_socket_finish
                                                        (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncResult" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> **source_object</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Finishes an async accept operation. See <a class="link" href="gio-GSocketListener.html#g-socket-listener-accept-socket-async" title="g_socket_listener_accept_socket_async ()"><code class="function">g_socket_listener_accept_socket_async()</code></a>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>listener</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GAsyncResult.html#GAsyncResult" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>source_object</code></em> :</span></p></td>
<td>Optional <a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> identifying this source. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> location to store the error occuring, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to
ignore.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a class="link" href="gio-GSocket.html#GSocket" title="GSocket"><span class="type">GSocket</span></a> on success, <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2">
<a name="g-socket-listener-close"></a><h3>g_socket_listener_close ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_socket_listener_close             (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>);</pre>
<p>
Closes all the sockets in the listener.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>listener</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a>
</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2">
<a name="g-socket-listener-set-backlog"></a><h3>g_socket_listener_set_backlog ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_socket_listener_set_backlog       (<em class="parameter"><code><a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> listen_backlog</code></em>);</pre>
<p>
Sets the listen backlog on the sockets in the listener.
</p>
<p>
See <a class="link" href="gio-GSocket.html#g-socket-set-listen-backlog" title="g_socket_set_listen_backlog ()"><code class="function">g_socket_set_listen_backlog()</code></a> for details
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>listener</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSocketListener.html#GSocketListener" title="GSocketListener"><span class="type">GSocketListener</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>listen_backlog</code></em> :</span></p></td>
<td>an integer</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
</div>
<div class="refsect1">
<a name="gio-GSocketListener.see-also"></a><h2>See Also</h2>
<a class="link" href="gio-GThreadedSocketService.html#GThreadedSocketService" title="GThreadedSocketService"><span class="type">GThreadedSocketService</span></a>, <a class="link" href="gio-GSocketService.html#GSocketService" title="GSocketService"><span class="type">GSocketService</span></a>.
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.17</div>
</body>
</html>